package com.board.form;
//外送订单参数
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;
@Data
@ApiModel("外送订单参数对象")
public class SendOrderForm {
    @ApiModelProperty("备注")
    private String remarks;
    @ApiModelProperty("餐厅id")
    @NotNull(message = "餐厅id不能为空")
    @Min(value = 0,message = "餐厅id不能小于0")
    private Integer canteenId;
    @ApiModelProperty("商店id")
    @NotNull(message = "商店id不能为空")
    @Min(value = 0,message = "商店id不能小于0")
    private Integer storeId;
    @ApiModelProperty("收货人名字")
    @NotNull(message = "收货人名字不能为空")
    private String addressName;
    @ApiModelProperty("收货人电话")
    @NotNull(message = "收货人电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式错误")
    private String addressPhone;
    @ApiModelProperty("收货人地址")
    @NotNull(message = "收货人地址不能为空")
    private String addressInfo;

    @ApiModelProperty("订单选择的菜品id和数量的集合")
    @NotNull(message = "订单选择的菜品id和数量的集合不能为空")
    @Valid
    @Size(min = 1,max = 30,message = "订单选择的菜品id和数量的集合最少为1最大为30")
    private List<FoodOrderForm> foodDtoList;
}
